package com.one.service;

import com.one.util.PageUtil;
import com.one.util.RequestReturn;
import com.one.util.RequestReturnFactory;
import com.one.vo.CommentVo;
import com.one.vo.ProductVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @ClassName: ProductService
 * @Auther: yph
 * @Date: 2022/1/19 09:08
 * @Description: 商品详情业务层接口
 */
//@Service
@FeignClient(name = "street-product")
public interface ProductService {

    /**
     * @Author: yph
     * @Date: 2022/1/19 09:10
     * @return:
     * @Description: 查询商品详情
     */
    @GetMapping("/product/queryProductById")
    RequestReturn<ProductVo> queryProductById(@RequestParam("userId") Integer userId,
                                              @RequestParam("id") Integer id,
                                              @RequestParam("sessionId")String sessionId);

    /**
     * @Author: yph
     * @Date: 2022/1/19 09:23
     * @return:
     * @Description: 查询商品的评论 分页查询
     */
    @GetMapping("/product/queryComments")
    RequestReturn<PageUtil<List<CommentVo>>> queryCommentByProductId(@RequestParam("productId") Integer productId,
                                                                     @RequestParam(value = "withPicture") String withPicture,
                                                                     @RequestParam(value = "pageNum") Integer pageNum,
                                                                     @RequestParam(value = "pageSize") Integer pageSize);

    /**
     * @Author: yph
     * @Date: 2022/1/20 10:12
     * @return: 
     * @Description: 查询所有子评论
    */
    @GetMapping("/product/queryCommentsByParentId")
    RequestReturn<List<CommentVo>> queryCommentByParentId(@RequestParam("parentId") Integer parentId);

}
